﻿<UserControl
	x:Class="DeltaEngine.Editor.MaterialEditor.MaterialEditorView"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:materialEditor="clr-namespace:DeltaEngine.Editor.MaterialEditor"
	mc:Ignorable="d"
	d:DesignHeight="800" d:DesignWidth="300"
	d:DataContext="{d:DesignInstance Type=materialEditor:MaterialEditorDesign,
		IsDesignTimeCreatable=True}">
	<UserControl.Resources>
		<Style TargetType="Label" x:Key="DeltaLabel">
			<Setter Property="FontSize" Value="14" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background" Value="#e2e2e2" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
			<Setter Property="Padding" Value="4,6,0,0" />
		</Style>

		<Style TargetType="Label" x:Key="DeltaLabelHeading1">
			<Setter Property="FontSize" Value="18" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
		</Style>

		<Style TargetType="Label" x:Key="DeltaLabelHeading2">
			<Setter Property="FontSize" Value="16" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
		</Style>

		<Style TargetType="TextBox" x:Key="DeltaTextBox">
			<Setter Property="FontSize" Value="14" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background" Value="#FFFBFBFB" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
			<Setter Property="BorderBrush" Value="#FFB2B2B2" />
			<Setter Property="Padding" Value="3,4,0,0" />
		</Style>

		<Style TargetType="ComboBox" x:Key="DeltaComboBox">
			<Setter Property="FontSize" Value="14" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background" Value="#FFFBFBFB" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
			<Setter Property="Padding" Value="5" />
		</Style>

		<Style TargetType="ListBox" x:Key="DeltaListBox">
			<Setter Property="FontSize" Value="14" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background" Value="#FFFBFBFB" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
		</Style>

		<Style TargetType="Button" x:Key="DeltaButton">
			<Setter Property="FontSize" Value="14" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Background">
				<Setter.Value>
					<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
						<GradientStop Color="#FFBBBBBB" Offset="0" />
						<GradientStop Color="#FF9E9E9E" Offset="1" />
					</LinearGradientBrush>
				</Setter.Value>
			</Setter>
			<Setter Property="BorderBrush" Value="Black" />
			<Setter Property="Foreground" Value="#FFFFFFFF" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Border Background="{TemplateBinding Background}">
							<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Style.Triggers>
				<Trigger Property="IsEnabled" Value="False">
					<Setter Property="Background" Value="#FFCFCFCF" />
				</Trigger>
				<MultiDataTrigger>
					<MultiDataTrigger.Conditions>
						<Condition
							Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}" Value="True" />
						<Condition
							Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled}" Value="True" />
					</MultiDataTrigger.Conditions>
					<Setter Property="Background" Value="#7894d3" />
				</MultiDataTrigger>
			</Style.Triggers>
		</Style>

		<Style TargetType="CheckBox" x:Key="DeltaCheckBox">
			<Setter Property="FontSize" Value="14" />
			<Setter Property="FontFamily" Value="Arial" />
			<Setter Property="FontStyle" Value="Normal" />
			<Setter Property="Foreground" Value="#FF5D5D5D" />
		</Style>

		<Style x:Key="TileButton" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Border Background="{TemplateBinding Background}"
						        BorderBrush="{TemplateBinding BorderBrush}"
						        BorderThickness="{TemplateBinding BorderThickness}">
							<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="BorderThickness" Value="0" />
			<Setter Property="Background" Value="#FF7894D3" />
			<Style.Triggers>
				<Trigger Property="IsMouseOver" Value="True">
					<Setter Property="Background" Value="#4e5fb3" />
				</Trigger>
				<Trigger Property="IsPressed" Value="True">
					<Setter Property="Background" Value="#4e5fb3" />
				</Trigger>
			</Style.Triggers>
		</Style>

	</UserControl.Resources>

	<Grid>
		<Grid Background="#FFF0F0F0" Margin="0,0,0,-10">
			<Grid.RowDefinitions>
				<RowDefinition Height="12" />
				<RowDefinition Height="28" />
				<RowDefinition Height="12" />
				<RowDefinition Height="28" />
				<RowDefinition Height="12" />
				<RowDefinition Height="28" />
				<RowDefinition Height="12" />
				<RowDefinition Height="28" />
				<RowDefinition Height="12" />
				<RowDefinition Height="28" />
				<RowDefinition Height="12" />
				<RowDefinition Height="28" />
				<RowDefinition Height="12" />
				<RowDefinition Height="28" />
				<RowDefinition Height="12" />
				<RowDefinition Height="40" />
				<RowDefinition Height="20" />
				<RowDefinition Height="40" />
				<RowDefinition Height="40" />
				<RowDefinition Height="40" />
				<RowDefinition Height="370.667" />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="12" />
				<ColumnDefinition Width="92" />
				<ColumnDefinition Width="8" />
				<ColumnDefinition />
				<ColumnDefinition Width="90" />
				<ColumnDefinition Width="30" />
				<ColumnDefinition Width="12" />
			</Grid.ColumnDefinitions>
			<Label Content="Image" Grid.Column="1" Grid.Row="5" Style="{StaticResource DeltaLabel}" />
			<ComboBox Grid.Column="3" Grid.Row="5" Style="{StaticResource DeltaComboBox}" ItemsSource="{Binding Path=ImageList}"
			          SelectedItem="{Binding Path=SelectedImage}" Grid.ColumnSpan="3" />
			<Label Content="Shader" Grid.Column="1" Grid.Row="13" Style="{StaticResource DeltaLabel}" />
			<ComboBox
				Grid.Column="3" Grid.Row="13" Style="{StaticResource DeltaComboBox}" Grid.ColumnSpan="3"
				ItemsSource="{Binding Path=ShaderList}"
				SelectedItem="{Binding Path=SelectedShader}" />
			<ComboBox Grid.Column="3" Grid.Row="1" ItemsSource="{Binding Path=MaterialList}"
			          Text="{Binding Path=MaterialName}" IsEditable="true" FontFamily="Arial" IsTextSearchEnabled="False"
			          FontSize="16" Foreground="#FF5D5D5D" Grid.ColumnSpan="3"
			          DropDownClosed="OnDropDownClosed" />
			<Button Grid.Column="4" Grid.Row="3" Grid.ColumnSpan="2" Content="Load Material" Click="LoadMaterial" />
			<Label Content="Default Color" Grid.Column="1" Grid.Row="11" Style="{StaticResource DeltaLabel}" />
			<ComboBox Grid.Column="3" Grid.Row="11" Style="{StaticResource DeltaComboBox}" Grid.ColumnSpan="3"
			          ItemsSource="{Binding Path=ColorStringList}" SelectedItem="{Binding Path=SelectedColor}" />
			<Label Content="Name" Grid.Column="1" Grid.Row="1" Style="{StaticResource DeltaLabel}" />
			<Button Style="{StaticResource DeltaButton}" Content="Save" Click="SaveMaterial" FontSize="22" FontWeight="Bold"
							Grid.ColumnSpan="2" Grid.Column="4" Grid.Row="15" IsEnabled="{Binding Path=CanSaveMaterial}" />
			<Label Content="Blend Mode" Grid.Row="7" Grid.Column="1" Style="{StaticResource DeltaLabel}" />
			<ComboBox Grid.ColumnSpan="3" Grid.Column="3" Grid.Row="7" Style="{StaticResource DeltaComboBox}"
			          ItemsSource="{Binding Path=BlendModeList}" SelectedItem="{Binding Path=SelectedBlendMode}" />
			<Label Content="RenderSize" Grid.Row="9" Grid.Column="1" Style="{StaticResource DeltaLabel}" />
			<ComboBox Grid.ColumnSpan="3" Grid.Column="3" Grid.Row="9" Style="{StaticResource DeltaComboBox}"
			          ItemsSource="{Binding Path=RenderStyleList}" SelectedItem="{Binding Path=SelectedRenderSize}" />
		</Grid>
	</Grid>
</UserControl>